// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import FastClick from 'fastclick'
import VueRouter from 'vue-router'
import App from './App'
import Home from './components/HelloFromVux'
import Game from './components/HelloWorld'
import 'element-ui/lib/theme-chalk/index.css'
import '@/element-ui'                         // api: https://github.com/ElemeFE/element
import '@/element-ui-theme'
import VueCookie from 'vue-cookie'
import httpRequest from '@/utils/httpRequest' // api: https://github.com/axios/axios
import { isAuth } from '@/utils'

Vue.use(VueRouter)
Vue.use(VueCookie)
// 挂载全局
Vue.prototype.$http = httpRequest // ajax请求方法
Vue.prototype.isAuth = isAuth     // 权限方法


window.SITE_CONFIG = {};

// api接口请求地址
// window.SITE_CONFIG['baseUrl'] = 'http://192.168.0.105:88/api';
// window.SITE_CONFIG['imgUrl'] = 'http://192.168.0.105:88';

window.SITE_CONFIG['baseUrl'] = 'http://106.55.134.242:88/api';
window.SITE_CONFIG['imgUrl'] = 'http://106.55.134.242:88';
// window.SITE_CONFIG['baseUrl'] = 'http://192.168.0.105:88/api';
// window.SITE_CONFIG['imgUrl'] = 'http://192.168.0.105:88';



// cdn地址 = 域名 + 版本号
window.SITE_CONFIG['domain']  = './'; // 域名
window.SITE_CONFIG['version'] = '';   // 版本号(年月日时分)
window.SITE_CONFIG['cdnUrl']  = window.SITE_CONFIG.domain + window.SITE_CONFIG.version;
window.isGaming = false

const routes = [{
  path: '/',
  component: Home,
  name: '/'
},{
  path: '/Game',
  component: Game,
  name: '/Game'
}]

const router = new VueRouter({
  routes
})

FastClick.attach(document.body)

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  router,
  render: h => h(App)
}).$mount('#app-box')
